package me.dao.impl;

import me.dao.AdminDao;
import me.dao.FactoryDao;
import me.dao.StudentDao;

/**
 * 实现dao工厂类生产各种dao
 */
public class FactoryDaoImpl implements FactoryDao {

    private static FactoryDaoImpl instance;

    public static FactoryDaoImpl getInstance(){
        if(instance==null){
            instance = new FactoryDaoImpl();
        }
        return instance;
    }

    FactoryDaoImpl(){}


    /**
     * 生产adminDao
     * @return
     */
    @Override
    public AdminDao createAdminDao() {
        return new AdminDaoImpl();
    }

    /**
     * 生产studentDao
     * @return
     */
    @Override
    public StudentDao createStudentDao() {
        return new StudentDaoImpl();
    }
}
